{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from ipymarkup.span import Span\n",
    "from ipymarkup.dep import Dep\n",
    "from ipymarkup.demo import show_table\n",
    "\n",
    "from ipymarkup import (\n",
    "    show_span_box_markup,\n",
    "    show_span_ascii_markup,\n",
    "    show_dep_markup\n",
    ")\n",
    "from ipymarkup.palette import palette, BLUE, ORANGE, PURPLE"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table><tr style=\"background: none\"><td style=\"width: 20%\"><div style=\"margin-top: 2em\">show_span_box_markup</div></td><td style=\"width: 20%\"><div style=\"margin-top: 2em\">show_span_line_markup</div></td><td style=\"width: 20%\"><div style=\"margin-top: 2em\">show_span_ascii_markup</div></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">a a a<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">a</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">b b<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">b</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffcdd2; background: #ffebee\">c c c<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #e57373;\">c</span></span></div></td><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><div><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\">a a a</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">a</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 8px\">b b</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">b</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #ef9a9a; padding-bottom: 8px\">c c c</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">c</span></span><span style=\"display: inline-block; vertical-align: top\"></span></div></div></td><td style=\"width: 20%\"><pre>a a a b b c c c\n",
       "a──── b── c────</pre></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">a a a<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">a</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">b b<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">b</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffcdd2; background: #ffebee\">c<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #e57373;\">c</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d1c4e9; background: #ede7f6\">e<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #9575cd;\">e</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffe0b2; background: #fff3e0\">d d d<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #ffb74d;\">d</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d7ccc8; background: #efebe9\">f f<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #a1887f;\">f</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">g g<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">g</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">h<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">h</span></span></div></td><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><div><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\">a a a</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">a</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 8px\">b b</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">b</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #ef9a9a; padding-bottom: 8px\">c</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">c</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #b39ddb; padding-bottom: 8px\">e</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">e</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 8px\">d d d</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">d</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #bcaaa4; padding-bottom: 8px\">f f</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">f</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\">g g</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">g</span></span><span style=\"display: inline-block; vertical-align: top\"> </span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 8px\">h</span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">h</span></span><span style=\"display: inline-block; vertical-align: top\"></span></div></div></td><td style=\"width: 20%\"><pre>a a a b b c e d d d f f g g h\n",
       "a──── b── c e d──── f── g── h</pre></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">a d a b a a a<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">a</span></span><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffe0b2; background: #fff3e0\">d a b a a a b c c c f d<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #ffb74d;\">d</span></span><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">b a a a b<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">b</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffcdd2; background: #ffebee\">c c c<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #e57373;\">c</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d7ccc8; background: #efebe9\">f<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #a1887f;\">f</span></span> d</div></td><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><div><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\">a </span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">a</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\">d a </span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">d</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 33px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 30px\">b a a a</span></span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -30px\">b</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 33px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 30px\"> b</span></span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #ef9a9a; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\">c c c</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">c</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #bcaaa4; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\">f</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">f</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\"> d</span></span><span style=\"display: inline-block; vertical-align: top\"></span></div></div></td><td style=\"width: 20%\"><pre>a d a b a a a b c c c f d\n",
       "a────────────   c──── f  \n",
       "  d──────────────────────\n",
       "      b────────          </pre></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">a b b c c d e f g h h i i a<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">a</span></span><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">b b<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">b</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffcdd2; background: #ffebee\">c c<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #e57373;\">c</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffe0b2; background: #fff3e0\">d<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #ffb74d;\">d</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d1c4e9; background: #ede7f6\">e<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #9575cd;\">e</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d7ccc8; background: #efebe9\">f<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #a1887f;\">f</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">g<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">g</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #c8e6c9; background: #e8f5e9\">h h<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #66bb6a;\">h</span></span> <span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffcdd2; background: #ffebee\">i i<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #e57373;\">i</span></span> a</div></td><td style=\"width: 20%\"><div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><div><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\">a </span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -8px\">a</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 19px\">b b</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">b</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ef9a9a; padding-bottom: 19px\">c c</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">c</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ffcc80; padding-bottom: 19px\">d</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">d</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #b39ddb; padding-bottom: 19px\">e</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">e</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #bcaaa4; padding-bottom: 19px\">f</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">f</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 19px\">g</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">g</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #a5d6a7; padding-bottom: 19px\">h h</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">h</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> </span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 22px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"><span style=\"border-bottom: 3px solid #ef9a9a; padding-bottom: 19px\">i i</span></span><span style=\"font-size: 11px; line-height: 1; white-space: nowrap; text-shadow: 1px 1px 0px white; position: absolute; left: 0; bottom: -19px\">i</span></span><span style=\"display: inline-block; vertical-align: top\"></span><span style=\"display: inline-block; vertical-align: top; position: relative; margin-bottom: 11px\"><span style=\"border-bottom: 3px solid #90caf9; padding-bottom: 8px\"> a</span></span><span style=\"display: inline-block; vertical-align: top\"></span></div></div></td><td style=\"width: 20%\"><pre>a b b c c d e f g h h i i a\n",
       "a──────────────────────────\n",
       "  b── c── d e f g h── i──  </pre></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div style=\"margin-top: 2em\">show_dep_markup</div></td><td style=\"width: 20%\"><div style=\"margin-top: 2em\">show_dep_ascii_markup</div></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\"><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 85%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">30</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 71%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 57%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">20</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 42%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 28%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">10</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 14%\"></span></span><span style=\"display: block\">aaaaa</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 60px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 57%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">31</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 50px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 42%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 28%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 28%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">21</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 14%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">01</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 14%\"></span></span><span style=\"display: block\">bbbbb</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 60px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 50px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 60px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 50px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 57%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 42%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">02</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 28%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 28%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">32</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 14%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">12</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 14%\"></span></span><span style=\"display: block\">ccccc</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 60px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 50px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 90px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 80px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 85%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 70px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 71%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">03</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 60px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 57%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 50px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 42%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">13</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 28%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 14%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">23</span></span></span><span style=\"display: block\">ddddd</span></span></div></td><td style=\"width: 20%\"><pre>┌►┌─────┌►┌─────┌►┌─ aaaaa 10\n",
       "│ │ ┌►┌─│ │ ┌►┌─└─└► bbbbb 01\n",
       "│ │ │ │ └─└►└─└──►┌─ ccccc 12\n",
       "└─└►└─└──►└───────└► ddddd 23</pre></td></tr><tr style=\"background: none\"><td style=\"width: 20%\"><div class=\"tex2jax_ignore\"><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 80%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 60%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">ea</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 40%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 20%\"></span></span><span style=\"display: block\">aaa</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 33%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">ab</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 33%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">cb</span></span></span><span style=\"display: block\">bbb</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 33%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 33%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">dc</span></span></span><span style=\"display: block\">ccc</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 66%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">ad</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 33%\"></span></span><span style=\"display: block\">ddd</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 30px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 33%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 33%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">ge</span></span></span><span style=\"display: block\">eee</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 50%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; left: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(5deg)\">gf</span></span></span><span style=\"display: block\">fff</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; width: 100%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 50px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 40px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 75%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">ag</span></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 20px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 50%\"></span><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 25%\"></span></span><span style=\"display: block\">ggg</span></span></div></td><td style=\"width: 20%\"><pre>┌─┌►┌───┌─ aaa ea\n",
       "│ │ │ ┌►└► bbb ab\n",
       "│ │ │ └─┌► ccc dc\n",
       "│ │ └──►└─ ddd ad\n",
       "│ └───┌──► eee ge\n",
       "│     │ ┌► fff gf\n",
       "└────►└─└─ ggg ag</pre></td></tr></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_table()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffe0b2; background: #fff3e0\">&lt;i&gt;</span>abc&lt;/i&gt;</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "text = '<i>abc</i>'\n",
    "spans = [Span(0, 3)]\n",
    "show_span_box_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"tex2jax_ignore\"><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 20px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; right: 0; border-top-left-radius: 5px; border-left: 1px solid #bdbdbd; transform: skew(-5deg); width: 50%\"></span></span><span style=\"display: block\">&lt;i&gt;abc&lt;/i&gt;</span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 20px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; width: 100%\"></span></span><span style=\"display: block\"> </span></span><span style=\"display: inline-block\"><span style=\"display: block; position: relative; min-width: 5px; height: 20px\"><span style=\"display: block; position: absolute; bottom: 0; border-top: 1px solid #bdbdbd; height: 10px; left: 0; border-top-right-radius: 5px; border-right: 1px solid #bdbdbd; transform: skew(5deg); width: 50%\"><span style=\"display: block; position: absolute; bottom: -1px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #bdbdbd; right: -3px\"></span><span style=\"display: block; position: absolute; top: -10px; line-height: 1; font-size: 9px; color: #9e9e9e; transform: skew(-5deg)\">&lt;b&gt;1&lt;/b&gt;</span></span></span><span style=\"display: block\">cde</span></span></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# to hide u' in python2\n",
    "words = ['<i>abc</i>', 'cde']\n",
    "spans = [Dep(0, 1, '<b>1</b>')]\n",
    "show_dep_markup(words, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\">\\begin{aligned}\n",
       "  \\nabla \\cdot \\vec{\\mathbf{B}} = 0\n",
       "\\end{aligned}</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "text = r'''\\begin{aligned}\n",
    "  \\nabla \\cdot \\vec{\\mathbf{B}} = 0\n",
    "\\end{aligned}'''\n",
    "spans = []\n",
    "show_span_box_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from ipymarkup.span import Span\n",
    "from ipymarkup.dep import Dep\n",
    "from ipymarkup.demo import show_table\n",
    "\n",
    "from ipymarkup import (\n",
    "    show_span_box_markup,\n",
    "    show_span_ascii_markup,\n",
    "    show_dep_markup\n",
    ")\n",
    "from ipymarkup.palette import palette, BLUE, ORANGE, PURPLE"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ascii"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a d a b a a a b c c c f d\n",
      "a────────────   c──── f  \n",
      "  d──────────────────────\n",
      "      b────────          \n"
     ]
    }
   ],
   "source": [
    "text = 'a d a b a a a b c c c f d'\n",
    "spans = [\n",
    "    Span(0, 13, 'a'),\n",
    "    Span(2, 25, 'd'),\n",
    "    Span(6, 15, 'b'),\n",
    "    Span(16, 21, 'c'),\n",
    "    Span(22, 23, 'f'),\n",
    "]\n",
    "\n",
    "show_span_ascii_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a d a b \n",
      "a───────\n",
      "  d─────\n",
      "      b─\n",
      "a a a b \n",
      "─────   \n",
      "────────\n",
      "─────── \n",
      "c c c f \n",
      "c──── f \n",
      "────────\n",
      "d\n",
      " \n",
      "─\n"
     ]
    }
   ],
   "source": [
    "show_span_ascii_markup(text, spans, width=8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0123456789\n",
      "abc   abcd\n",
      " abcdef── \n",
      "0123456789\n",
      "─────     \n"
     ]
    }
   ],
   "source": [
    "text = '01234567890123456789'\n",
    "spans = [\n",
    "    Span(6, 15, 'abcdef'),\n",
    "    Span(0, 3, 'abcdef'),\n",
    "    Span(1, 9, 'abcdef')\n",
    "]\n",
    "show_span_ascii_markup(text, spans, width=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "123\n"
     ]
    }
   ],
   "source": [
    "text = '123'\n",
    "spans = []\n",
    "show_span_ascii_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 1\n",
      " ─\n",
      "34\n",
      "──\n"
     ]
    }
   ],
   "source": [
    "text = '''\\t1\n",
    "34'''\n",
    "spans = [Span(1, 5)]\n",
    "show_span_ascii_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0123456\n",
      "─────  \n",
      "───    \n",
      "a──    \n",
      "c──    \n"
     ]
    }
   ],
   "source": [
    "text = '''0123456'''\n",
    "spans = [\n",
    "    Span(0, 5),\n",
    "    Span(0, 3),\n",
    "    Span(0, 3, 'a'),\n",
    "    Span(0, 3, 'c')\n",
    "]\n",
    "show_span_ascii_markup(text, spans)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0123456\n",
      "─────  \n",
      "───    \n",
      "a──    \n",
      "c──    \n"
     ]
    }
   ],
   "source": [
    "class C(object):\n",
    "    def __init__(self, start, stop, type):\n",
    "        self.start = start\n",
    "        self.stop = stop\n",
    "        self.type = type\n",
    "\n",
    "        \n",
    "spans = [\n",
    "    (0, 5),\n",
    "    [0, 3],\n",
    "    (0, 3, 'a'),\n",
    "    C(0, 3, 'c'),\n",
    "]\n",
    "show_span_ascii_markup(text, spans)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Palette"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">12</span>3<span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">456<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">PER</span></span>7<span style=\"padding: 2px; border-radius: 4px; border: 1px solid #ffe0b2; background: #fff3e0\">89<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #ffb74d;\">LOC-a</span></span>0</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "text = '1234567890'\n",
    "spans = [(0, 2), (3, 6, 'PER'), (7, 9, 'LOC-a')]\n",
    "show_span_box_markup(text, spans, palette=palette(BLUE, {None: BLUE, 'LOC-a': ORANGE}, PER=BLUE))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"tex2jax_ignore\" style=\"white-space: pre-wrap\"><span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">12</span>3<span style=\"padding: 2px; border-radius: 4px; border: 1px solid #d1c4e9; background: #ede7f6\">456<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #9575cd;\">PER</span></span>7<span style=\"padding: 2px; border-radius: 4px; border: 1px solid #bbdefb; background: #e3f2fd\">89<span style=\"vertical-align: middle; margin-left: 2px; font-size: 0.7em; color: #64b5f6;\">LOC-a</span></span>0</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "show_span_box_markup(text, spans, palette=palette('blue', PURPLE, {None: 'blue', 'PER': 'purple'}))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
